//
//  RHProductIntroduceVC.m
//  RuiHeAppApp
//
//  Created by Yan Chen on 2023/9/23.
//

#import "RHProductIntroduceVC.h"

@interface RHProductIntroduceVC ()<UIScrollViewDelegate>
@property(nonatomic ,strong)UIImageView *imageView;
@end

@implementation RHProductIntroduceVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"Product Detail";
    [self setupUI];
}

-(void)setupUI
{
    UIScrollView *scrollView = [[UIScrollView alloc]init];
    scrollView.minimumZoomScale = 1;
    scrollView.maximumZoomScale=5.0;
    scrollView.delegate = self;
    [self.view addSubview:scrollView];
    [scrollView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.insets(UIEdgeInsetsZero);
    }];
    
    NSString *filepath = [[NSBundle mainBundle]pathForResource:@"Xtreme.jpg" ofType:nil];
    _imageView = [[UIImageView alloc]initWithImage:[UIImage imageWithContentsOfFile:filepath]];
    [scrollView addSubview:_imageView];
    [_imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.insets(UIEdgeInsetsZero);
        make.width.mas_offset(kUI_WINDOW_W);
        make.height.mas_offset(kUI_WINDOW_W*6736/1191);
    }];
}
-(UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView
{
    return self.imageView;
}
@end
